<template>
<div class="container">
  <ul class="tabs-header">
      <li v-for="(item,index) in tabs" :key="item" @click="handleClick(index)" :class="{active:curIndex==index}">
        {{item.name}}
      </li>
  </ul>
  <div class="content">
    <div v-show="curIndex==0">
      <tab-base :id="id"/>
    </div>
    <div v-show="curIndex==1">
      <tab-sucai :id="id"/>
    </div>
    <div v-show="curIndex==2">
      <tab-appear :id="id"/>
    </div>
 </div>
</div>
</template>
<script>
import mitem from '@/components/monster/Mitem'
import tabBase from '@/components/monster/desc/TabBase'
import tabSucai from '@/components/monster/desc/TabSucai'
import tabAppear from '@/components/monster/desc/TabAppear'

export default {
  props: [
    'id'
  ],
  data () {
    return {
      tabs: [{name: '基本信息'}, {name: '怪物素材'}, {name: '任务出现'}],
      curIndex: 0
    }
  },
  methods: {
    handleClick (index) {
      this.curIndex = index
    }
  },
  components: {
    mitem,
    tabBase,
    tabSucai,
    tabAppear
  },
  mounted () {
    this.curIndex = 0
  }
}
</script>
<style scoped>
.tabs-header {
  list-style-type: none;
  display: flex;
  flex-direction: row;
}
.tabs-header li {
  float: left;
  flex-grow: 1;
  text-align: center;
  padding: 10px;
  color:#1d97c1;
  font-size: 14px;
  font-weight: bold;
  border-bottom: 3px solid #ffffff;
  transition: all .1s;
}
li.active {
  border-bottom-width: 100%;
  border-bottom: 3px solid #607D8B;
}
.content-item{
  width: 100%;
}
::-webkit-scrollbar{
  width: 0;
  height: 0;
  color: transparent;
}
.cactive{
  padding: 1px;
  background-color: #ffffff;
}
.tabs-header{
  background-color: #ffffff;
}
</style>
